package com.labot.dao.hibernate;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.labot.dao.BitacoraDao;
import com.labot.model.Bitacora;
@Repository("BitacoraDao")
public class BitacoraDaoHibernate extends HistoryTackerDaoHibernate<Bitacora, Long> implements BitacoraDao {

    /**
     * Constructor that sets the entity to User.class.
     */
    public BitacoraDaoHibernate() {
        super(Bitacora.class);
    }

    /**
     * {@inheritDoc}
     */
    @SuppressWarnings("unchecked")
    public List<Bitacora> getBitacoraUser(Integer id) {
		Query qry = getSession().createQuery("from Bitacora b WHERE b.idCliente = id order by b.fecha desc");
		qry.setParameter("id", id);
        return (List<Bitacora>) qry.list();
    }

}
